package org.lanqiao.oa.dao;

import org.apache.ibatis.annotations.Param;
import org.lanqiao.oa.mapper.PaginationCondition;
import org.lanqiao.oa.mapper.User;

import java.util.List;

public interface UserDao {

    List<User> findByPage(@Param("current") Integer current,@Param("size") Integer size);

    /**
     * 新增用户
     * @param user
     * @return
     */
    Integer saveUser(User user);

    /**
     * 根据id查询用户
     * @param id
     * @return
     */
    User selectById(String id);

    /**
     * 根据id删除用户
     * @param uid
     * @return
     */
    Integer deleteUserByUid(String uid);

    /**
     * 修改用户
     * @param user
     * @return
     */
    Integer updateUserById(User user);

    /**
     * 修改用户状态
     * @param uid
     * @param status
     * @return
     */
    Integer updatelockStatus(@Param("uid") String uid, @Param("status") Integer status);

    /**
     * 根据条件查询用户
     * @param condition
     * @return
     */
    List<User> selectUserByCondition(PaginationCondition condition);

    /**
     * 根据条件查询用户数量
     * @param condition
     * @return
     */
    Integer selectUserByConditionCount(PaginationCondition condition);

    /**
     * 用户登录
     * @param user
     * @return
     */
    User login(User user);

}
